package com.fcl.blog.service.impl;

import com.fcl.blog.exception.ServiceException;
import com.fcl.blog.mapper.TagMapper;
import com.fcl.blog.po.Tag;
import com.fcl.blog.service.TagService;
import com.fcl.blog.vo.TagVo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Author 付
 * @Date 2023/10/18 15:52
 * @Version 1.0
 * @description
 * @since 1.0
 */
@Service
public class TagServiceImpl implements TagService {
    @Autowired
    private TagMapper tagMapper;


    @Transactional
    @Override
    public List<Tag> findListTag() {

        List<Tag> listTag = tagMapper.findListTag();

        return listTag;
    }

    @Transactional
    @Override
    public int insertTag(TagVo tag) {
        return tagMapper.insertTag(tag);
    }

    @Override
    public Tag selectByName(String name) {
        return tagMapper.selectByName(name);
    }


    @Transactional
    @Override
    public int deleteById(Long id) {
        return tagMapper.deleteById(id);
    }


    @Transactional
    @Override
    public int updateTag(TagVo tagVo) {
        return tagMapper.updateTag(tagVo);
    }
}
